package com.young.context;

public enum Cloud {

    AWS("aws"),
    ALI("ali"),
    TEN("ten"),
    DEFAULT("default");

    public final String code;

    Cloud(String code) {
        this.code = code;
    }

    public static Cloud codeOf(String code) {
        for (Cloud e : values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }

    public static boolean supported(String cloud) {
        return codeOf(cloud) != null;
    }
}
